const app = getApp()
Page({

       
  data: {
          catelist:["男装","女装","零食","家电","床上用品","家具"],
          bannerlist:[{
            url:"../../images/banner1.jpg"
          },{
            url:"../../images/banner2.jpg"
          },{
            url:"../../images/banner3.jpg"
          }
        ],
        latitude:"",
        longittude:"",
        danmulist:[
          {
            text:"网院",
            color:"#ff0000",
            time:10

        },{
          text:"电大",
          color:"#e64e69",
          time:30
        }
      ]

  },
  onLoad(){
          
  },
  checkboxChange:function(e){
    var then = this;
    var likestr ="";
    for (let index = 0; index < e.detail.value.length; index++) {
      likestr = likestr+ e.detail.value[index];
      
    }
    
    then.setData({
      likes:likestr
    })
console.log(e)
console.log(e.detail.value[0])
  },
saveUserInfo:function(){
  var data={"name":"魏诗桓","student_id":"201965110454"}
      wx.setStorageSync('userinfo', data)
      wx.setStorage({
        key:"studentinfo",
        data:{"sex":"男","age":21}
      })
},
getUserInfo:function(){
   var studentinfo = wx.getStorageSync('studentinfo');
   console.log(studentinfo);
   wx.getStorage({
     key:"userinfo",
     success(res){
       then.setData({
         latitude:then.data.latitude,
         longitude:then.data.longittude,
         name:"湖南开放大学终教楼1104",
         address:"湖南省长沙市天心区青园路168号1104"
       })
     }
   })
   wx.getSystemInfo({
     success: (option) => {
       console.log(option)
     },
   })
},
removeUserInfo:function(){
wx.removeStorage({
  key: 'userinfo',
})
wx.removeStorageSync('studentinfo');
},
getLocal:function(){
  var then = this;
  wx.getLocation({
    success(res){
      then.setData({
        latitude:res.latitude,
        longittude:res.longitude,
      })
    }
  })
},
openMap:function(){
  var then = this;
  wx.openLocation({
    latitude: then.data.latitude,
    longitude: then.data.longittude,
  })
},
selectLocal:function(){

},
})   

  